#pragma once
#ifndef _TETRISSHAPE_
#define _TETRISSHAPE_

#include "Block.h"
#include "ShapeStruct.h"
#endif // !TETRISSHAPE


class TetrisShape
{
private:
	ShapeStruct* m_next;
	ShapeStruct* m_preview;
	ShapeStruct* m_current;

	void SetCube(UINT row, UINT col, XMFLOAT4 color, UINT8 isShow, UINT8 type) {
		m_data[row * 10 + col].color = color;
		m_data[row * 10 + col].isShow = isShow;
		m_data[row * 10 + col].type = type;
	};

	ShapeStruct* RandomNext();
public:
	TetrisShape();
	CELLCUBE m_data[200] = { 0 };
	void RandomShape();

	BOOLEAN IsFull();
	BOOLEAN IsBlock();
	bool IsBottom();
	void MoveDown();
	void MoveQuickly();
	void MoveLeft();
	void MoveRight();
	void Drop();
	void ChangeDirection();
	void Reset();
	void RemoveRows();

	CELLCUBE GetCube(UINT row, UINT col) { return m_data[row * 10 + col]; };

	ShapeStruct* GetCurrent() { return m_current; }
};

